<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>编辑学生信息</title>
    <link rel="stylesheet" th:href="@{/webjars/bootstrap/4.0.0/css/bootstrap.css}"/>
    <script type="text/javascript" th:src="@{/webjars/jquery/3.3.1/jquery.js}"></script>
    <script type="text/javascript" th:src="@{/webjars/bootstrap/4.0.0/js/bootstrap.js}"></script>
    <style>
        html, body {
            background-color: #F8F8FF;
        }

        .r {
            cursor: no-drop;
            border: 0;
        }
    </style>
</head>
<body>
<h1 style="color:blue;text-align: center;">编辑学生信息</h1>

<br/>
<br/>
<div style="width:75%;position:absolute;left:170px;">
    <form th:action="@{/stu/edit/ok/}">
        <table class="table table-striped table-hover table-bordered table-condensed">
            <thead>
            <tr>
                <th>学号</th>
                <th>姓名</th>
                <th>专业</th>
                <th>数据结构</th>
                <th>Java应用</th>
                <th>Mysql基础</th>
                <th>平均分</th>
                <th>表现</th>
            </tr>
            </thead>
            <tbody>
            <tr th:each="s:${stu}">
                <td>
                    <input type="text" name="id" th:value="${s.id}" readonly size="1" class="r"/>
                </td>
                <td>
                    <input type="text" name="name" th:value="${s.name}" size="6"/> <!--${s.cla}-->
                </td>
                <td>
                    <div class="form-group" style="width:300px;margin:auto;">
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="cla" value="软件工程"
                                   th:checked="${s.cla!=null}?${s.cla=='软件工程'}">
                            <label class="form-check-label">软件工程</label>
                        </div>
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="cla" value="计算机技术"
                                   th:checked="${s.cla!=null}?${s.cla=='计算机技术'}">
                            <label class="form-check-label">计算机技术</label>
                        </div>
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="cla" value="信息安全"
                                   th:checked="${s.cla!=null}?${s.cla=='信息安全'}">
                            <label class="form-check-label">信息安全</label>
                        </div>
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="cla" value="人工智能"
                                   th:checked="${s.cla!=null}?${s.cla=='人工智能'}">
                            <label class="form-check-label">人工智能</label>
                        </div>
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="cla" value="嵌入式"
                                   th:checked="${s.cla!=null}?${s.cla=='嵌入式'}">
                            <label class="form-check-label">嵌入式</label>
                        </div>
                        <div class="form-check form-check-inline">
                            <input class="form-check-input" type="radio" name="cla" value="数字媒体技术"
                                   th:checked="${s.cla!=null}?${s.cla=='数字媒体技术'}">
                            <label class="form-check-label">数字媒体技术</label>
                        </div>
                    </div>
                </td>
                <td>
                    <input type="text" name="s1" th:value="${s.s1}" size="3"/>
                </td>
                <td>
                    <input type="text" name="s2" th:value="${s.s2}" size="3"/>
                </td>
                <td>
                    <input type="text" name="s3" th:value="${s.s3}" size="3"/>
                </td>
                <td>
                    <input type="text" name="avg" th:value="${s.avg}" readonly size="3" class="r"/>
                </td>
                <td>
                    <div th:switch="${session.loginUserRole}">
                        <div th:case="0">
                            <input type="text" name="memo" th:value="${s.memo}" readonly size="5"
                                   class="r"/>
                        </div>
                        <div th:case="1">
                            <input type="text" name="memo" th:value="${s.memo}" size="5"
                                   style="cursor:pointer;border:0;"/>
                        </div>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>

        <div style="position: absolute;margin-left:45%;">
            <button type="submit" class="btn btn-success btn-lg" style="margin-top:8px;">保存</button>
        </div>
    </form>
</div>

</body>
</html>